<%@page import="java.util.List,com.crm.entity.Opportunity" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/temp.dwt" codeOutsideHTMLIsLocked="false" -->
<head>

<link href="<%=application.getContextPath()%>/css/css-crm.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/datatable.css"/>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.6.min.js"></script>	
<script language="JavaScript" src="<%=application.getContextPath()%>/js/gen_validatorv4.js"
    type="text/javascript" ></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.validate.js"></script>	
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.7.2.min.js"></script>
<script language="javaScript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/colResizable-1.3.min.js"></script>
 <script type="text/javascript" language="javascript" src="<%=application.getContextPath()%>/js/jquery.dataTables.nightly.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script  type="text/javascript">
$(document).ready(function() {
		$('#pendQuot').dataTable();
	} );
</script>
</head>

<body>
<div id="main">
  <%@ include file="common/header.jsp" %>
  <%@ include file="common/submenu.jsp" %>
  <div id="content"><!-- InstanceBeginEditable name="EditRegion3" -->
  <form name="" action="<%=application.getContextPath() %>/pendingQuot/update.do" method="post">
    <div id="work-area2">
      <div class="heading2">Pending Quotations</div>
	  
      <div class="boxIFS">
      <div id="demo">
        <table id="pendQuot" width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
      <thead>
          <tr>
            <th width="30" align="center" valign="middle" background="<%=application.getContextPath()%>images/table-box.jpg"  style="background-repeat:repeat-x">S.No </th>
            <th width="140" align="center" valign="middle" background="<%=application.getContextPath()%>images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Client Name</th>
            <th width="162" align="center" valign="middle" background="<%=application.getContextPath()%>images/table-box.jpg"  style="background-repeat:repeat-x bgcolor="#FFFFFF">Reference No.</th>
            <th width="186" align="center" valign="middle" background="<%=application.getContextPath()%>images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Details</th>
            <th width="186" align="center" valign="middle" background="<%=application.getContextPath()%>images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Remarks</th>
          </tr>
          </thead>
          <tbody>
           <%
          List<Opportunity> lopp=(List<Opportunity>)request.getAttribute("opplist");
          if(lopp!=null){
        	  for(int i=0;i<lopp.size();i++){
          %>
          <input type="hidden" id="id<%=i+1%>" name="id<%=i+1%>" value="<%=lopp.get(i).getId()%>"/>
          <tr>
            <td align="center" bgcolor="#FFFFFF"><input name="sno<%=i+1 %>"  value="<%=i+1 %>" type="text" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="client<%=i+1 %>" type="text" size="5" value="<%=lopp.get(i).getClientId().getOrganisation()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="refNo<%=i+1 %>" type="text" size="5" value="<%=lopp.get(i).getRefNum()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><a href="#" onclick="javascript:open_new_window('<%=application.getContextPath()%>/pendingQuot/get_history.do?refid=<%=lopp.get(i).getId() %>')" class="linkclass">Given Quotation</a></td>
          <td align="left" valign="top" bgcolor="#FFFFFF"><a href="<%=application.getContextPath()%>/pendingQuot/closeQuot.do?refid=<%=lopp.get(i).getId()%>" class="linkclass" >Close Quotation</a></td>
          </tr>
          <%
        	  }
          }
          %>
          </tbody>
          <input type="hidden" value="<%=lopp.size() %>" name="rowCount"/>
  
        </table>
      </div>
      </div>
	  <div class="boxIFS">
	    <div class="buttton-main">
	    <input type="submit" class="button" value="Update"/>
	    <div class="button">Close</div></div>
	  </div>
	  
    </div>
    </form>
    <table style="height:300px; width:910px;" ><tr><td>
	   <div class="boxtable" id="result">
	   <div id="partsDiv"></div>
	  </div>
	  </td>
	  </tr>
	  </table>
    <!-- InstanceEndEditable -->
       </div><div id="footer"></div>  
</div>
</body>
<!-- InstanceEnd --></html>
<script>
function open_new_window(url) {
	  window.open(url,"some_name","width=500,height=300,left=200,top=10");
	}
</script>
